The current preference API - buildPrefsWidget() - predates client-side
decorations. While extension authors have been finding ways around
the limitation of not having access to the window/titlebar, the change
to the new Adwaita API seems like a good time for an updated API that
officially provides that access (as far as allowed by libadwaita).
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2012>
const prefsModule = extension.imports.prefs;
prefsModule.init(extension.metadata);
- const widget = prefsModule.buildPrefsWidget();
- const page = this._wrapWidget(widget);
- this.add(page);
+ if (prefsModule.fillPreferencesWindow) {
+ prefsModule.fillPreferencesWindow(this);
+
+ if (!this.visible_page)
+ throw new Error('Extension did not provide any UI');
+ } else {
+ const widget = prefsModule.buildPrefsWidget();
+ const page = this._wrapWidget(widget);
+ this.add(page);
+ }
} catch (e) {
this._showErrorPage(e);
logError(e, 'Failed to open preferences');